﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web_Blog
{
    public partial class DangKi : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["uID"] != null)
                Response.Redirect("TrangChu.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Object.CreateAccountObject acc = new Object.CreateAccountObject();

            acc.Nick = txt_tentruycap.Text;
            acc.Pass = txt_matkhau.Text;
            acc.Name = txt_hoten.Text;
            acc.Birth = txt_ngaysinh.Text;
            acc.Sex = int.Parse(ddl_gioitinh.SelectedValue.ToString());
            acc.Email = txt_Email.Text;
            acc.Phone = "";
            acc.About = "";

            if (Controler.Account.CreateAccount(acc) == 1)
                Response.Redirect("DangNhap.aspx?r=ok");
        }
    }
}